home *** CD-ROM | disk | FTP | other *** search
- conn$module:
- do;
-
- /* CONNECT: Establish a "virtual terminal" connection through a */
- /* specified serial i/o port. Here, port 0 represents the console. */
-
- declare port byte external;
- declare debug byte external;
-
-
- print: procedure(msg) external;
- declare msg address;
- end print;
-
-
- nout: procedure(n) external;
- declare n address;
- end nout;
-
-
- newline: procedure external; end newline;
-
-
- ready: procedure (port) byte external;
- declare port byte;
- end ready;
-
-
- csts: procedure byte external;
- end csts;
-
-
- putc: procedure (c, port) external;
- declare (c, port) byte;
- end putc;
-
-
- getc: procedure (port) byte external;
- declare port byte;
- end getc;
-
-
- connect:
- procedure public;
- declare port2cmd literally '0F7H';
- declare rx$rdy literally '02H';
- declare (c,temp) byte;
-
- if debug then
- do;
- call print(.('connecting to serial port $'));
- call nout(port);
- call newline;
- end;
- call print(.('you are now connected to VAX/VMS $'));
- call newline;
- call print(.('type ctrl-D to return to ISIS-Kermit $'));
- call newline;
- do while (1);
- temp = csts;
- if temp > 0 then do;
- c = getc(0);
- if c = 4 then do;
- /* type ctrl-d to return to main program */
- call newline;
- return;
- end;
- call putc(c, port);
- end;
- if ready(port) > 0 then call putc(getc(port), 0);
- end;
- end connect;
-
- end conn$module;
-